<<#if elementGenerator.isMultilayer(relation)>el-dialog ${elementGenerator.getDivVIf(relation)} width="80%"<#else>el-card</#if> ${elementGenerator.getSubAttrs(relation)} v-ab-permission:show="tablePermission.${relation.busObj.key}.${relation.tableKey}" >
    <div class="ab-form-title" <#if elementGenerator.isMultilayer(relation)>slot="title"<#else>slot="header"</#if> ><span class="title">${relation.tableComment}</span>
        <ab-sub-add class="el-button el-button--primary" v-model="${elementGenerator.getScopePath(relation)}" v-bind:init-data="initData.${relation.busObj.key}.${relation.tableKey}" v-ab-permission:edit="tablePermission.${relation.busObj.key}.${relation.tableKey}">添加 </ab-sub-add>
        <ab-sub-exp class="el-button el-button--primary" v-model="${elementGenerator.getScopePath(relation)}" table-key="${relation.tableKey}" v-ab-permission:edit="tablePermission.${relation.busObj.key}.${relation.tableKey}">导出</ab-sub-exp>
        <ab-sub-imp class="el-button el-button--primary" v-model="${elementGenerator.getScopePath(relation)}" table-key="${relation.tableKey}" v-ab-permission:edit="tablePermission.${relation.busObj.key}.${relation.tableKey}">导入</ab-sub-imp>
    </div>
    <div>
        <table class="i-iview-table">
            <thead>
            <tr>
                <#list group.columnList as groupColumn>
                    <th v-ab-permission:show="permission.${relation.busObj.key}.${groupColumn.tableKey}.${groupColumn.key}">${groupColumn.comment}</th>
                </#list>
                <th>操作</th>
            </tr>
            </thead>
            <tr scope="" v-slot="scope" :permissiona="permission" :table-permissiona="tablePermission" v-for="(${relation.tableKey},index) in ${elementGenerator.getScopePath(relation)}" <#if elementGenerator.isMultilayer(relation)> class="ivu-form ivu-form-label-right" </#if> >
                <#list group.columnList as groupColumn>
                    <td v-ab-permission:show="scope.permission.${relation.busObj.key}.${groupColumn.tableKey}.${groupColumn.key}">${elementGenerator.getColumn(group,groupColumn)}</td>
                </#list>
                <td> <button-group>${getOne2ManyChild(relation)}
                        <ab-sub-del  class="el-button el-button--error" v-model="${elementGenerator.getScopePath(relation)}" v-bind:index="index" v-ab-permission:edit="scope.tablePermission.${relation.busObj.key}.${relation.tableKey}">移除</ab-sub-del>
                    </button-group>
                </td>
            </tr>
        </table>
    </div>
    </<#if elementGenerator.isMultilayer(relation)>el-dialog<#else>el-card</#if>>

    <#function getOne2ManyChild relation>
    <#assign relationList = relation.getChildren('oneToMany')>
    <#assign rtn>
        <#if relationList?? && (relationList?size > 0) >
            <#list relationList as relation>
                <ab-sub-detail v-bind:sub-temp-data.sync="subTempData" pkey="${relation.parent.tableKey}" class="el-button el-button--default"  v-model="${elementGenerator.getScopePath(relation.parent)}<#if relation.parent.type =='oneToMany'>[index]</#if>" table-key="${relation.getBusObj().getKey()}_${relation.tableKey}" v-ab-permission:show="scope.tablePermission.${relation.busObj.key}.${relation.tableKey}" >${relation.tableComment}详情</ab-sub-detail>
            </#list>
        </#if>
    </#assign>
    <#return rtn>
</#function>
